<?php

namespace BP\CompteBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use BP\CompteBundle\Entity\Operation;

class OperationType extends AbstractType
{

	public function getDefaultOptions(array $options)
	{
	    return array(
	        'data_class' => 'BP\CompteBundle\Entity\Operation',
	    );
	}


    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('label')
		->add('compte_id', 'hidden')
        	->add('valeur')
        	->add('description')
        	->add('type','choice',array('choices' => array( 1 => 'créditer', 0 => 'débiter')))
        	->add('category_id', 'choice', array('choices' => array(
        	1 => 'Transports',
        	2 => 'Courses',
        	3 => 'Autres')));
    }

    public function getName()
    {
        return 'bp_comptebundle_operationtype';
    }
}
